<%@ page import="com.bean.User" %>
<%@ page import="com.bean.Passage" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>主页</title>
    <!-- load stylesheets -->
    <link rel="shortcut icon" href="webicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400">  <!-- Google web font "Open Sans" -->
    <link rel="stylesheet" href="css/bootstrap.min.css">                                      <!-- Bootstrap style -->
    <link rel="stylesheet" href="css/magnific-popup.css">                                <!-- Magnific pop up style, http://dimsemenov.com/plugins/magnific-popup/ -->
    <link rel="stylesheet" href="css/templatemo-style.css">                                   <!-- Templatemo style -->

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>


<div class="container">
    <div class="row">
        <div class="tm-left-right-container">
            <!-- Left column: logo and menu -->
            <div class="tm-blue-bg tm-left-column">
                <div class="tm-logo-div text-xs-center">
                    <img src="img/yoyo_logo.png" alt="Logo">
                </div>
                <nav class="tm-main-nav">
                    <ul class="tm-main-nav-ul">
                        <li class="tm-nav-item">
                            <% if(session.getAttribute("user") != null) {
                                String name = ((User)(session.getAttribute("user"))).getName();%>
                            <a>账户：${user.name}</a>

                            <% }else {%>
                            <a onclick="window.location.href='login.jsp'">登录/注册</a>
                            <%}%>
                        </li>
                        <li class="tm-nav-item">
                            <a onclick="window.location.href='travelList.jsp?page=1'" class="tm-nav-item-link">驴友游记</a>
                        </li>
                        <li class="tm-nav-item">
                            <a onclick="window.location.href='share.jsp'" class="tm-nav-item-link">发布游记</a>
                        </li>
                        <li class="tm-nav-item">
                        <% if(session.getAttribute("user") != null) {
                                int ID = ((User)(session.getAttribute("user"))).getUsername();%>
                            <a onclick="window.location.href='UserServlet?method=admin&ID=<%=ID%>'" class="tm-nav-item-link">个人中心</a>

                            <% }else {%>
                            <a onclick="window.location.href='travelList.jsp?page=1'">随便看看</a>
                            <%}%>
                            
                        </li>
                    </ul>
                </nav>
            </div> <!-- Left column: logo and menu -->


            <!-- Right column: content -->
            <div class="tm-right-column">
                <figure>
                    <img src="img/index.jpg" alt="Header image" class="img-fluid">
                </figure>

            </div> <!-- Right column: content -->
        </div>
    </div> <!-- row -->
</div> <!-- container -->

<!-- load JS files -->
<script src="js/jquery-1.11.3.min.js"></script>             <!-- jQuery (https://jquery.com/download/) -->
<script src="js/jquery.magnific-popup.min.js"></script>     <!-- Magnific pop-up (http://dimsemenov.com/plugins/magnific-popup/) -->
<script src="js/jquery.singlePageNav.min.js"></script>      <!-- Single Page Nav (https://github.com/ChrisWojcik/single-page-nav) -->
<script>

    $(document).ready(function(){

        // Single page nav
        $('.tm-main-nav').singlePageNav({
            'currentClass' : "active",
            offset : 20
        });

        // Magnific pop up
        $('.tm-gallery-1').magnificPopup({
            delegate: 'a', // child items selector, by clicking on it popup will open
            type: 'image',
            gallery: {enabled:true}
            // other options
        });

        $('.tm-gallery-2').magnificPopup({
            delegate: 'a', // child items selector, by clicking on it popup will open
            type: 'image',
            gallery: {enabled:true}
            // other options
        });

        $('.tm-gallery-3').magnificPopup({
            delegate: 'a', // child items selector, by clicking on it popup will open
            type: 'image',
            gallery: {enabled:true}
            // other options
        });

        $('.tm-current-year').text(new Date().getFullYear());
    });
</script>
</body>
</html>